import java.util.Scanner;

public class test {

    //求一个整数，在内存当中存储时，二进制1的个数。
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count = 0;
        for(int i = 0; i < 32; i++) {
            if(((n >> i) & 1) == 1) {
                count++;
            }
        }
        System.out.println(count);
    }

    //给定两个数，求这两个数的最大公约数
    public static void main6(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = a % b;
        while(c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }


    //1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100
    public static void main5(String[] args) {
        int flag = 0;
        double sum = 1.0;
        for(int i = 2; i < 101; i++) {
            if(i % 2 != 0) {
                //为奇数
                flag = 1;
            }else {
                flag = -1;
            }
            sum += 1.0 / i * flag;
        }
        System.out.println(sum);
    }

    //求出0～n之间的所有“水仙花数”并输出。(“水仙花数”是指一个三位数，其各位数字的立方和确好等于该数本 身，如；153＝1^3＋5^3＋3^3，则153是一个“水仙花数“。）
    public static void main4(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int b = 0;
        int a = 0;
        for(int i = 100; i <= n; i++) {
            int sum = 0;
            a = i;
            while(a != 0) {
                b= a % 10;
                sum += Math.pow(b, 3);
                a /= 10;
            }
            if(sum == i) {
                System.out.print(i + " ");
            }
        }
        System.out.println();
    }

    //打印X图形
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        int m = in.nextInt();
        int n = in.nextInt();
        for(int i = 0; i < m; i++) {
            for(int j = 0; j < n; j++) {
                if(i == j || i + j == n - 1) {
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }

    //给定一个数字，判定一个数字是否是素数
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int flag = 0; // 不为素数
        for(int i = 2; i < n; i++) {
            if(n % i == 0) {
                flag = 1;
                break;
            }
        }
        if(flag == 0) {
            System.out.println("不是素数");
        }else {
            System.out.println("是素数");
        }
    }

    //编写程序数一下 1到 100 的所有整数中出现多少个数字9
    public static void main1(String[] args) {
        int count = 0;
        for(int i = 0; i <= 100; i++) {
            if(i % 10 == 9 || i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
}
